// Author: dnorlov@google.com (Dmitry Orlov)

#include <assert.h>

#include "command.h"
#include "command_test.h"

namespace assembler_test {

void TestCommand::Test() {
  assembler::Command cmd_ret(assembler::RET);
  assert(cmd_ret.type() == assembler::RET);
  assert(cmd_ret.is_valid());

  assembler::Command cmd_invalid_call(assembler::CALL);
  assert(cmd_invalid_call.type() == assembler::INVALID_COMMAND);
  assert(!cmd_invalid_call.is_valid());

  assembler::CommandArgument register_argument;
  register_argument.type = assembler::ARGUMENT_REGISTER;
  register_argument.arg.register_id = 0;

  assembler::Command cmd_invalid_ret(assembler::RET, register_argument);
  assert(!cmd_invalid_ret.is_valid());
}

}  // namespace assembler_test
